<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 备选字符集--规定某一位字符的备选字符列表 
         特点：多个里面选一个-->
    <script>
        // var str = "上海，上天，上马";
        // var reg = /上[海天马]/g;
        // console.log(str.replace(reg,'*'))
        var s = "你sb，它sx，她sd"
        var r = /s[bxd]/g;
        console.log(s.replace(r,"*"))
    </script>
</body>
</html>